<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddReadRightAndCostToTopicsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('topics', function (Blueprint $table) {
            //
            $table->tinyInteger('read_right')->default(0)->comment('帖子阅读权限,0:都可以阅览，1:登录后可看');
            $table->tinyInteger('read_cost')->default(0)->comment('阅读贴子所需的积分数');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('topics', function (Blueprint $table) {
            //
            $table->dropColumn('read_right');
            $table->dropColumn('read_cost');
        });
    }
}
